M E S S A G E B O X M A K E R by Gordon Burnham 631 Iroquois Avenue Louisville, KY 40214-1226 USA Tel (502) 366-7833 MESSAGE BOX MAKER Copyright (c) Gordon Burnham 1994. All rights reserved. MESSAGE BOX MAKER is a proprietary computer software product provided by its copyright holder, Gordon Burnham (631 Iroquois Avenue, Louisville, KY); both the software and its documentation are copyrighted, and you may not copy or use either except as expressly provided in writing by Gordon Burnham. MESSAGE BOX MAKER for Windows, Version 1.7, is offered on a shareware (try before you buy) basis. If you find this program useful and/or use it after a 30-day trial period, you are expected to register it with the author. Registration is $15 MESSAGE BOX MAKER is written in Visual Basic and therefore will require the 'VBRUN300.DLL' which comes with Visual Basic. If you have an older version, you can get this one from the MSBASIC forum on Compuserve. If you have problems with the VBX, try putting it in your 'windows\system' directory. You will also need the THREED.VBX which ships with the Professional version. This is also available from the MSBASIC forum on Compuserve. If you use Visual Basic Constants, you will need to include 'CONSTANT.TXT' that Microsoft ships with Visual Basic. It appears that Microsoft forgot to include a couple of constants in the 'CONSTANT.TXT' file, so you will need to add them. They can be found under the 'MsgBox Function' in the Language Reference book and are shown here for your convenience. Global Const MB_APPLMODAL = 0 Global Const MB_SYSTEMMODAL = 4096 MESSAGE BOX MAKER is a utility designed for Visual Basic programmers. It a very handy mechanism for creating "Message Boxes". It allows you to build a message box, test it, modify and test again until you get it right. You can then paste the code into a function or subroutine. I have found it very useful for creating message boxes for User approval. It makes it very easy to create, 'screen print' and place into a Word for Windows document. Several variations can be done this way very quickly to determine the best for a certain situation. A number of programmers have told me that what they like most about MESSAGE BOX MAKER is that they don't have to remember or look up the codes for the buttons, icons, setting the default button, return values from the button clicked or how to make the message box application modal or system modal. Essentially, you create the message box, test it, when it's the way you want it, click the 'Copy to Clipboard' button, go to the place in your code where you want the message box and perform a paste. Voila! The complete code for the message box is there, requiring only that you enter the code for the appropriate response to the buttons chosen for the particular message box. NOTES ABOUT USE: This readme file is the only documentation for MESSAGE BOX MAKER since, for even novice Visual Basic programmers, it is fairly obvious how to use it. The following information is provided so that you don't have to experiment to find out how they work, but you'll probably want to do that anyway! When building the message box you have several options for how you want the code to be generated. 1. Use Visual Basic Constants - checking this will cause the code to be generated with VB constants. You will need to make sure that 'Contant.Txt' (from Microsoft) is included in a code module. If unchecked, then actual numbers will be used. 2. No variables - checking this will cause the message box 'text' and message box title to appear as string literals in the "MsgBox" call. 3. Variables WITH DIM statements. This will add the "Dim MBMsg$, MBTitle$" line to the generated code and the variables 'MBMsg$' and 'MBTitle$' will be used to hold the 'text' & 'title' strings. If you have already used variable declarations within the Function or Subroutine, you will get a VB error message telling you the declaration is a "duplicate declaration", so you will want to watch out for this. 4. Variables WITHOUT DIM statements - The line "Dim MBMsg$, MBTitle$" will not be included in the code. The variables 'MBMsg$' and 'MBTitle$' will be used to to hold the 'text' and 'title' strings. You can add a 'Beep' signal to the message box code if you wish. The message box can be made Application Modal or System Modal as you desire. Application Modal means the user can't select anything else in the application, but can select other programs and do other things in windows. System Modal means your user can't do anything else until they respond to the message. Message boxes can be generated using different combinations of these items to suit your particular preference. NEW FEATURES in Ver. 1.7 ======================== Message Box Maker uses the MsgBox Function in all cases except when the 'OK' button is the only one desired. It then uses the MsgBox Statement instead (no 'Case' statements). The "Show Code" button on the 'Code' tab opens a window and displays the code as it will appear in your Visual Basic Code window. If you can't see the entire code, use the vertical and horizontal scroll bars to move around to view the entire code. Carriage returns can now be embedded in the Message Box text by pressing keys. This will permit formatting of the text in the message box window to your liking instead of defaulting to the way windows handles it. Tabs can be embedded in the Message Box text by pressing keys. You can't use the key alone, because it will simply tab to the next active control in the Tab Order. NOTE: Something I do frequently is embed variables in the Message Box text. The message box will not display correctly in test mode when you do this, however, it will work correctly when called within Visual Basic code. To embed variables, you must do it the following way: <...your message box text> " + + " - OR - <...your message box text> " + + " The important thing to note is that there must be a double quote and a plus sign (" +) preceeding the variable name and a plus sign and a double quote (+ ") following the variable name. The part following the variable is required whether you have additional text or not due to the way the message box function parameters are built so that VB sees it correctly as a combination of 'Code' and 'Strings'. Using this technique, you can do something like this: Staff Account: 0052019 A refresh diskette will be created for this account! Is this what you want to do? Yes No A is entered first then the text 'Staff Account: ' followed by " + StaffAcctNum.Text + " then and the rest of the text. It won't look right in the test, but it will appear correctly when you paste the code into your module and run the application. =============================================================== END OF README.TXT ===============================================================